﻿using System;
using System.Net;

namespace WebAssertTestLibrary.Core
{
    public class WebClientWithTimeout : WebClient
    {
        public TimeSpan Timeout { get; set; }

        protected override WebRequest GetWebRequest(Uri address)
        {
            var webRequest = base.GetWebRequest(address);
            webRequest.Timeout = Convert.ToInt32(Timeout.TotalMilliseconds);
            return webRequest;
        }
    }
}